home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
libs
/
knowhow4
/
pcxstrm.h
< prev
next >
Wrap
C/C++ Source or Header
|
1994-10-10
|
587b
|
32 lines
#ifndef __PCX_STREAM__
#define __PCX_STREAM__
#include <stdio.h>
#include <Simple.h>
const BUFFER_LENGTH = 1024;
class pcxstream
{
public:
pcxstream(FILE * f);
bool isValid() { return buffer != 0; }
void read(unsigned char * dest, int n);
int pcxstream::get()
{
if(pos == BUFFER_LENGTH)
{
fread(buffer, 1, BUFFER_LENGTH, file);
pos = 0;
}
return buffer[pos++];
} // read char
~pcxstream();
private:
unsigned char * buffer;
int pos;
FILE * file;
};
#endif __PCX_STREAM__